package com.moli.iov.base.enums;
/**
 * <p>
 * 异常登录 处理结果
 * </p>
 *
 * @author zql
 * @since 2020/2/20 15:26
 */
public enum UnauthResultEnum {

  /**
   * 同意登入
   */
  PASS(1, "同意登入"),

  /**
   * 拒绝登入
   */
  NOT_PASS(2, "拒绝登入");

  private int flag;

  private String msg;

  UnauthResultEnum(int flag, String msg) {
    this.flag = flag;
    this.msg = msg;
  }

  public static String getMsg(Integer flag){

    if(flag == null){
      return "";
    }

    for(UnauthResultEnum e : UnauthResultEnum.values()){
      if(e.flag == flag){
        return e.getMsg();
      }
    }
    return "";
  }

  public int getFlag() {
    return flag;
  }

  public String getMsg() {
    return msg;
  }
}
